package com.offlinerssreader.controller;

import org.json.JSONException;
import org.json.JSONObject;

public class ActionResponse implements ReturnableResponse {
	String actionName;
	boolean actionStatus;
	String msg;
	Object data;
	
	public ActionResponse(String name, boolean status, String msg, Object data) {
		this.actionName = name;
		this.actionStatus = status;
		this.msg = msg;
		this.data = data;
	}

	public boolean getStatus() {
		return this.actionStatus;
	}
	
	public String toJson() throws JSONException {
		JSONObject returnJson = new JSONObject();
		returnJson.put("actionName", actionName);
		returnJson.put("status", actionStatus);
		returnJson.put("msg", msg);
		return returnJson.toString();
	}
	
	public Object getData() {
		return this.data;
	}
}
